home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib / c / div.man < prev    next >
Encoding:
Text File  |  1989-03-22  |  1.4 KB  |  47 lines

  1. ' Copyright 1989 Regents of the University of California
  2. ' Permission to use, copy, modify, and distribute this
  3. ' documentation for any purpose and without fee is hereby
  4. ' granted, provided that this notice appears in all copies.
  5. ' The University of California makes no representations about
  6. ' the suitability of this material for any purpose.  It is
  7. ' provided "as is" without express or implied warranty.
  8. ' $Header: /sprite/src/lib/c/stdlib/RCS/div.man,v 1.1 89/01/05 18:00:18 ouster Exp $ SPRITE (Berkeley)
  9. .so \*(]ltmac.sprite
  10. .HS div cmds
  11. .BS
  12. .SH NAME
  13. div, ldiv \- Return quotient and remainder from division
  14. .SH SYNOPSIS
  15. .nf
  16. \fB#include <stdlib.h>
  17.  
  18. \fBdiv_t
  19. div(\fInumer, denom\fB)\fR
  20.  
  21. \fBldiv_t
  22. ldiv(\fInumer, denom\fB)\fR
  23. .SH ARGUMENTS
  24. .AP int numer in
  25. Numerator for division.
  26. .AP int denom in
  27. Denominator for division.
  28. .BE
  29.  
  30. .SH DESCRIPTION
  31. .PP
  32. The \fBdiv\fR and \fBldiv\fR procedures divide \fInumer\fR by \fIdenom\fR
  33. and return both the quotient and remainder, in the \fBquot\fR and
  34. \fBrem\fR fields of the result structure.  If the division is inexact,
  35. the sign of the resulting quotient is that of the algebraic quotient, and
  36. the magnitude of the resulting quotient is the largest integer less than
  37. the magnitude of the algebraic quotient.
  38. .PP
  39. \fBDiv\fR takes \fBint\fR
  40. arguments and produces \fBint\fR results, while \fBldiv\fR works with
  41. \fBlong int\fR arguments and results.
  42.  
  43. .SH KEYWORDS
  44. divide, quotient, remainder
  45.